In the Ching Dynasty some 300-400 years ago, the emperor liked to dress casual and visit incognito his kingdom. One day in a restaurant, the emperor, after pouring himself a cup of tea, filled the servant's cup as well, act which was a huge grace to the servant. The servant wanted to kneel down and thank his master. But he was stopped because that would give away the emperor's identity. So instead of kneeling on his knees, the servant kneed with his fingers tapping on the table. That ‘thanks’ finger taps on the table are still in use today in the 21st century.
In guitar playing finger tapping is the act of tapping the fingers against guitar strings in order to produce sounds, rather than striking or plucking the strings. Specifically, it usually refers to two-handed tapping, that is, tapping involving both the left and right hand. It is not clear who discovered tapping, but it was popularized, by guitarist Eddie van Halen.